# Maintainer: Brendan Forster <brendan@github.com>

_realname="git-lfs"
pkgbase="mingw-w64-${_realname}"
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=2.11.0
pkgrel=1
pkgdesc="An open source Git extension for versioning large files"
install=git-lfs.install
arch=('any')
url="https://github.com/git-lfs/git-lfs"
src_zip_url="${url}/archive/v${pkgver}.zip"
license=('MIT')
groups=('VCS')

case "$CARCH" in
i686)
  zipname="git-lfs-windows-386-v$pkgver.zip"
  folder=.
  sha256sum=6de91f3ee5f82304bba99211609323a4ba6f6846e80e5f9e368f3c2d30564d66
  exesuffix=
  ;;
x86_64)
  zipname="git-lfs-windows-amd64-v$pkgver.zip"
  folder=.
  sha256sum=ca05b0b9bd39d99665045776a5d0d5c7bfa2605a6118c2f489bfd40c2c3e4f2c
  exesuffix=
  ;;
esac

source=("https://github.com/github/git-lfs/releases/download/v$pkgver/$zipname"
	"$src_zip_url")

# Git LFS' source .zip now contains symbolic links that bsdtar does not like...
noextract=("${src_zip_url##*/}")

sha256sums=("$sha256sum" SKIP)
options=('!strip')

package() {
  install -d -m755 $pkgdir/$MINGW_PREFIX/bin
  install -m755 $srcdir/$folder/git-lfs$exesuffix.exe $pkgdir/$MINGW_PREFIX/bin/git-lfs.exe
  install -d -m755 $pkgdir/$MINGW_PREFIX/share/doc/git-lfs
  install -m755 $srcdir/$folder/README.md $pkgdir/$MINGW_PREFIX/share/doc/git-lfs/README.md
}
